import request from '@/utils/request'
// 1班级信息明细
//  class_name:
// state:
// page: 1
// limit:10
export const studentList = params => request({
  method: 'GET',
  url: '/class/student',
  params
})

// 编辑
export const eritStudent = (data) => request({
  method: 'PUT',
  url: `/class/student/${data.id}`,
  data

})
// 删除
export const delStudent = (data) => request({
  method: 'DELETE',
  url: `/class/student`,
  data

})

// 新增
export const addStudent = data => request({
  method: 'POST',
  url: '/class/student',
  data

})

// 单个学生信息
export const studentInfoApi = id => request({
  url: `/class/student/${id}`,
  method: 'GET'
})

// 4. 详情
export const getStudent = id => request({
  method: 'GET',
  url: `/class/student/${id}`
})

// 引入学生信息
export const importStudent = data => request({
  method: 'post',
  url: `/class/student/import`,
  data: {
    list: data
  }
})

// 修改单个学生信息
export function updateStudentInfoApi(data) {
  return request({
    url: `/class/student/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除单个学生信息
export function delStudentInfoApi(data) {
  return request({
    url: `/class/student`,
    method: 'DELETE',
    data
  })
}

// 批量禁用学生状态
export function batchChangeState(data) {
  return request({
    url: '/class/studentChangeStatus',
    method: 'PUT',
    data
  })
}
